<template>
  <span>
      <button @click="add">+</button>
      {{num}}
      <button @click="sub">-</button>
  </span>
</template>

<script>
export default {
  name: 'mid-com',
  props: ['num', 'index'],
  methods: {
    add () {
      this.$emit('chNum', this.num, this.index, 'add')
    },
    sub () {
      this.$emit('chNum', this.num, this.index, 'sub')
    }
  }
}
</script>

<style>

</style>
